/****************************************************
    文件：SwitchBounds.cs
	作者：Jack
    日期：#CreateTime#
	功能：Nothing
*****************************************************/

using UnityEngine;
using Cinemachine;

public class SwitchBounds : MonoBehaviour 
{

    private void Start()
    {
        SwitchConfinerShape();
    }
    private void SwitchConfinerShape()
    {
        PolygonCollider2D confinerShape=GameObject.FindGameObjectWithTag("BoundsConfiner").GetComponent<PolygonCollider2D>();
        CinemachineConfiner confiner=GetComponent<CinemachineConfiner>();
        confiner.m_BoundingShape2D = confinerShape;
        confiner.InvalidatePathCache();   //清除缓存
    }
}